﻿// -----------------------------------------------------------------------
// <copyright file="ErrorController.cs" company="EPAM Systems">
////Copyright (c) EPAM Systems, 2012. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------
namespace MBOP.Website.Controllers
{
	#region Usings

	using System.Web.Mvc;

	using MBOP.Website.CustomResults;

	#endregion

	/// <summary>
	/// Provides methods that redirects to error pages.
	/// </summary>
	public class ErrorController : Controller
	{
		#region

		/// <summary>
		/// Represents error view name.
		/// </summary>
		private const string ERROR_VIEW_NAME = "Error";

		#endregion

		/// <summary>
		/// Gets the error information to the user.
		/// </summary>
		/// <param name="message">The error message.</param>
		/// <returns>The view result, which encapsulates information of the result processing.</returns>
		public ViewResult Index(string message)
		{
			return new ErrorResult(ERROR_VIEW_NAME, message);
		}
	}
}
